home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act6b / 00044.ls < prev    next >
Encoding:
Text File  |  1995-03-28  |  2.3 KB  |  63 lines

  1. on enterFrame
  2.   global partlist, abug, bbug, piecelist, listparts
  3.   repeat with xxx = 4 to 33
  4.     puppetSprite(xxx, 1)
  5.   end repeat
  6.   repeat with xxx = 41 to 46
  7.     puppetSprite(xxx, 1)
  8.   end repeat
  9.   set bugnumber to 3
  10.   set partlist to [:]
  11.   addProp(partlist, random(2), random(6))
  12.   addProp(partlist, random(4), 1)
  13.   addProp(partlist, random(4), 1)
  14.   addProp(partlist, random(2), random(9))
  15.   addProp(partlist, 1, random(5))
  16.   addProp(partlist, random(4), 1)
  17.   set bbug to random(4)
  18.   repeat with abug = 1 to 4
  19.     if abug <> bbug then
  20.       set abugchan to 9 + ((abug - 1) * 6)
  21.       repeat with thispiece = 1 to 6
  22.         set binky to [:]
  23.         addProp(binky, random(2), random(6))
  24.         addProp(binky, random(4), 1)
  25.         addProp(binky, random(4), 1)
  26.         addProp(binky, random(2), random(9))
  27.         addProp(binky, 1, random(5))
  28.         addProp(binky, random(4), 1)
  29.         repeat while binky = partlist
  30.           set binky to [:]
  31.           addProp(binky, random(2), random(6))
  32.           addProp(binky, random(4), 1)
  33.           addProp(binky, random(4), 1)
  34.           addProp(binky, random(2), random(9))
  35.           addProp(binky, 1, random(5))
  36.           addProp(binky, random(4), 1)
  37.         end repeat
  38.         set sigil to getAt(getAt(piecelist, bugnumber), thispiece)
  39.         set apiece to getAt(getAt(sigil, getPropAt(binky, thispiece)), getAt(binky, thispiece))
  40.         if apiece > 0 then
  41.           set the castNum of sprite (abugchan + thispiece) to apiece
  42.         end if
  43.       end repeat
  44.     end if
  45.   end repeat
  46.   set abug to bbug
  47.   set abugchan to 9 + ((abug - 1) * 6)
  48.   repeat with thispiece = 1 to 6
  49.     set sigil to getAt(getAt(piecelist, bugnumber), thispiece)
  50.     set apiece to getAt(getAt(sigil, getPropAt(partlist, thispiece)), getAt(partlist, thispiece))
  51.     if apiece > 0 then
  52.       set the castNum of sprite (abugchan + thispiece) to apiece
  53.       set apart to "part" & bugnumber & "." & thispiece & "." & getPropAt(partlist, thispiece)
  54.       set apart to getAt(getAt(getAt(listparts, bugnumber), thispiece), getPropAt(partlist, thispiece))
  55.       set the castNum of sprite (3 + thispiece) to apart
  56.     end if
  57.     set the castNum of sprite (40 + thispiece) to 1 + getAt(castnumber, getAt(partlist, thispiece))
  58.   end repeat
  59.   repeat with xxx = 1 to 33
  60.     set the visible of sprite xxx to 1
  61.   end repeat
  62. end
  63.